package com.uinnova.product.eam.db.impl;

import com.uinnova.product.eam.comm.model.OceanDiagram;
import com.uinnova.product.eam.db.OceanDiagramDao;
import com.uinnova.product.eam.db.support.dao.mybatis.ComMyBatisBinaryDaoImpl;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class OceanDiagramDaoImpl extends ComMyBatisBinaryDaoImpl<OceanDiagram, OceanDiagram> implements OceanDiagramDao {

    @Override
    public OceanDiagram selectLastOne() {
        return getSqlSession().selectOne(getTableName() + ".selectLastOne");
    }

    @Override
    public void deleteByDiagramIds(Set<String> deleteDiagramIds) {
        Map<String, Set<String>> map = new HashMap<>();
        map.put("diagramIds", deleteDiagramIds);
        getSqlSession().delete(getTableName() + ".deleteByDiagramIds", map);
    }

    @Override
    public void deleteAll() {
        getSqlSession().delete(getTableName() + ".deleteAll");
    }
}
